let seen = new Set();
let tmp = [];
let tmpID = [];

for (let i = 0; i < $this.dataSource.length; i++) {
    const val = $this.dataSource[i].body_1760949474694_E3hwT;
    const id = $this.dataSource[i].body_1760949474694_E3hwT_ID;

    // 跳过无效值（你可以根据需要调整判断条件）
    if (val === undefined || val === "" || id === undefined || id === "") continue;

    const key = `${val}|${id}`; // 用组合键去重
    if (!seen.has(key)) {
        seen.add(key);
        tmp.push(val);
        tmpID.push(id);
    }
}

//多个表体的字段值赋值到同一个表头

// 获取已有 ID 值
let existingID = document.getElementById("systemSelect_1760949829640_kHyqY_ID").value || "";
console.log(" 已有查看计划任务 = ",existingID);
// 去重拼接（可选：避免重复）
let existingSet = new Set(existingID.split(",").filter(id => id.trim() !== ""));
tmpID.forEach(id => existingSet.add(id));
// 重新拼接
let finalID = Array.from(existingSet).join(",");
$this.formModel.systemSelect_1760949829640_kHyqY_ID = finalID
document.getElementById("systemSelect_1760949829640_kHyqY_ID").value = finalID.slice(0, -1)


// 获取已有值
let existing = $this.formModel.systemSelect_1760949829640_kHyqY || "" // document.getElementById("systemSelect_1760949829640_kHyqY").value || "";
console.log(" 已有查看计划任务名称 = ",existing);
// 去重拼接（可选：避免重复）
let existingSetName = new Set(existing.split(",").filter(id => id.trim() !== ""));
tmp.forEach(id => existingSetName.add(id));
// 重新拼接
let final = Array.from(existingSetName).join(",");
$this.formModel.systemSelect_1760949829640_kHyqY = final;
